#ifndef _CPU_H_
#define _CPU_H_

#define EFLAGS_IF	(1 << 9)

#include <arch/types.h>
#include <arch/Paging.h>
#include <kernel/Scheduler.h>

class CPU {
public:
	Scheduler *Sched;

	PageDirectory *PageDir;

	static void Halt();
	static dword DisableInterrupts();
	static dword EnableInterrupts();
	static void RestoreInterrupts(dword oldFlags);
	static dword ReadCR0();
	static dword ReadCR1();
	static dword ReadCR2();
	static dword ReadCR3();
	static dword ReadCR4();
	static void WriteCR0(dword value);
	static void WriteCR1(dword value);
	static void WriteCR2(dword value);
	static void WriteCR3(dword value);
	static void WriteCR4(dword value);
};

extern CPU *CPUs[256];
extern CPU CPU0;


#endif
